{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "fc5f3c5c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[93, 95, 91, 99, 98, 94, 95]\n"
     ]
    }
   ],
   "source": [
    "stu_id = [92,93,95,91,99,98,94,92,95]\n",
    "\n",
    "# 方法1： remove()\n",
    "\n",
    "while True:\n",
    "    if 92 in stu_id:\n",
    "        stu_id.remove(92)\n",
    "    else:\n",
    "        break\n",
    "print(stu_id)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "77fd66fc",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[93, 95, 91, 99, 98, 94, 95]\n"
     ]
    }
   ],
   "source": [
    "stu_id = [92,93,95,91,99,98,94,92,95]\n",
    "\n",
    "# 方法2： pop()\n",
    "# print(stu_id.index(92))\n",
    "\n",
    "for index,item in enumerate(stu_id):\n",
    "#   print(index,item)\n",
    "    if item == 92:\n",
    "#       print(index)\n",
    "        stu_id.pop(index)\n",
    "print(stu_id)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
